comp.lang.c
[Top] [All Lists]

Re: [Makefile]How can I deal with multi-dirs?

Subject: Re: [Makefile]How can I deal with multi-dirs?
From: Antoninus Twink
Date: Tue, 1 Apr 2008 12:16:24 +0200 CEST
Newsgroups: comp.lang.c

On  1 Apr 2008 at  8:05, M.Liang Liu wrote:
> I have a project with the following dirs:
> ---------------------------------------------------------------------------------------
> +src
>  |-proj0
>      |-program1
>      |-program2
>  |-proj1
>      |-program1
>      |-program2
>      |-program3
>      |-program4
>  |-proj3
>      |-program1
>      |-program2
>      |-program3
>    ....
>  |-proj9
> -Makefile
> +include
> -README
> +lib
>  |-lib1
>  |-lib2
> ---------------------------------------------------------------------------------------
> There are 10 project-dirs here in src, named proj0-proj9. Each project
> has several program_dirs which containing some .c files
> All .h files are under include in the top dir, the same as src.
>
> I would like to write a makefile, which can help me compile all the .c
> files and generate an executable file for each *program*.  Considering
> there are several independent programs in each project, the work
> should be done within a single makefile at the top dir.
>
> How can I deal all the programs under each project in a single top-
> level makefile?

Which part of the section of your make program's documentation on
recursive use of make didn't you understand?


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy